#!/bin/bash

filename=/var/lib/mysql/mysqldump/petclinic.dump.`date +"%d.%m.%y_%H-%M-%S"`.sql.gz

mysqldump --single-transaction -u petclinic --password=paweligawel12 petclinic | gzip > $filename
#mysqldump --single-transaction -u petclinic --password=paweligawel12 petclinic  > $filename


unlink /var/lib/mysql/mysqldump/last.petclinic.dump.sql.gz

ln -s $filename /var/lib/mysql/mysqldump/last.petclinic.dump.sql.gz
